<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <script src="${base}/js/settings.js"></script>
    <script>
      const authority = "${authority}";
      const base_url = "${base}/";
      const domain = "${domain}";
      const contextPath = "${base}";
      const origin = window.location.origin;
      const redirectBase = origin + (contextPath.lastIndexOf('/') == contextPath.length - 1 ? contextPath : contextPath + '/');
      window.__env = {
        // 个人中心
        homePersonCenter: get_home_page(domain,"home_PersonCenter"),
        // 主页
        homepage: get_home_page(domain),
        homepageOauth: get_home_page_oauth(domain),
        // 来华交换生
        exchangeStudent: getExchangeStudentInfo(domain),
        // 出国公示
        publicity_go_detail: getKey(domain, "publicity_go_detail"),
        // 回国公示
        publicity_return_detail: getKey(domain, "publicity_return_detail"),
        /**
         * 顶级域名
         */
        domain: domain,
        contextPath: contextPath,
        engieUrl:"${engieUrl}",
        base_url: base_url,
        /**
         * 导出exce所有模板
         */
        excel_template: {
          department_sending_template: base_url+"excel_template/部门发文模板.xlsx",
          department_receving_template: base_url+"excel_template/部门收文模板.xlsx",
          school_sending_template: base_url+"excel_template/校级发文模板.xlsx",
          school_receving_template: base_url+"excel_template/校级收文模板.xlsx",
          signing_application_template: base_url+"excel_template/请示签报模板.xlsx",
          asist_asign_template: base_url+"excel_template/交办协办模板.xlsx",
        },
        /**
         * OpenID Connect 配置
         */
        oidc: {
          authority: authority,
          metadata: {
            issuer: authority,
            authorization_endpoint: authority + "/authorize",
            userinfo_endpoint: authority + "/userinfo",
            end_session_endpoint: authority.split('sso')[0]  + "sso/logout?redirect_uri=" + encodeURI(origin + '${base}'),
            jwks_uri: authority + "/jwks.json",
          },
          clientId: "${clientId}",
          redirectUri: redirectBase + "oidc-callback?retUrl=" + encodeURI(window.location.href),
          responseType: "id_token token",
          scope: "${scopes}",
          automaticSilentRenew: true,
          silentRedirectUri: redirectBase + "silent-renew-oidc.html",
          silentRequestTimeout : 3 * 1000
        },

        /**
         * 数据应用网关的各种服务的地址
         */
        canvas: {
          builtin: {
            path: "${builtin}",
          },
          provider: {
            path: "${provider}",
          },
          graphql_public: {
            path: "${graphql_public}",
          },
        },
      };
    </script>
    <link rel="icon" href="${base}/favicon.ico" />
    <title>OA系统</title>
  </head>

  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <script src=${base}/js/chunk-vendors.js></script>
    <script src=${base}/js/app.js></script>
  </body>
</html>
